package com.maserb.monitor.web.schoolStudent;

import com.maserb.monitor.common.AjaxResult;
import com.maserb.monitor.common.AjaxUtils;
import com.maserb.monitor.common.Func_T;
import com.maserb.monitor.entity.schoolStudent.SchoolTimeTableEntity;
import com.maserb.monitor.service.schoolStudent.SchoolTimeTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 课程表
 */
@Controller
@RequestMapping("/timeTable")
public class SchoolTimeTableController {


    @Autowired
    SchoolTimeTableService schoolTimeTableService;

    /**
     * app
     * @param clazzId
     * @return
     */
    @RequestMapping("/clazzTimeTable")
    @ResponseBody
    public AjaxResult<List<SchoolTimeTableEntity>> clazzTimeTable(final String clazzId) {
        return  AjaxUtils.process(new Func_T<List<SchoolTimeTableEntity>>() {
            @Override
            public List<SchoolTimeTableEntity> invoke() throws Exception {
                return schoolTimeTableService.findByClazz(clazzId);
            }
        });
    }
}
